/*
Copyright (C) 2012  Nikos Siatras
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.*/
package ncore_tcp_port_forward;

import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.UIManager;
import ncore_tcp_port_forward.UI.frmMain;

/**
 *
 * @author Nikos Siatras
 */
public class NCore_TCP_Port_Forward
{

    public static void main(String[] args)
    {
        try
        {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
        catch (Exception ex)
        {
        }

        java.awt.EventQueue.invokeLater(new Runnable()
        {

            // Set System L&F
            @Override
            public void run()
            {
                frmMain form = new frmMain();
                try
                {
                    Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();

                    int w = form.getSize().width;
                    int h = form.getSize().height;
                    int x = (dim.width - w) / 2;
                    int y = (dim.height - h) / 2;

                    form.setLocation(x, y);
                }
                catch (Exception ex)
                {
                }
                form.setVisible(true);
            }
        });
    }
}
